package com.lansi.blegateway.bean;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;


public class Blegateway implements Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Integer id;
	private String deveui;
	private String alias;
	private String mapid;
	private float x;
	private float y;
	private String alarm;
	private String alarmStr;
	private String rang;
	private String rangStr;
	private String sn;
	private String name;
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private Date recv;
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private Date offtimebegin;
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private Date offtimeend;
	private String type;
	private String typeStr;
	private Integer rssi;
	private float snr;
	private String battery;
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private Date statustime;
	private String memo;
	
	public Blegateway() {
		super();
	}

	public Blegateway(Integer id, String deveui, String alias, String mapid, float x, float y, String alarm,
			String alarmStr, String rang, String rangStr, String sn, String name, Date recv, Date offtimebegin,
			Date offtimeend, String type, String typeStr, Integer rssi, float snr, String battery, Date statustime,
			String memo) {
		super();
		this.id = id;
		this.deveui = deveui;
		this.alias = alias;
		this.mapid = mapid;
		this.x = x;
		this.y = y;
		this.alarm = alarm;
		this.alarmStr = alarmStr;
		this.rang = rang;
		this.rangStr = rangStr;
		this.sn = sn;
		this.name = name;
		this.recv = recv;
		this.offtimebegin = offtimebegin;
		this.offtimeend = offtimeend;
		this.type = type;
		this.typeStr = typeStr;
		this.rssi = rssi;
		this.snr = snr;
		this.battery = battery;
		this.statustime = statustime;
		this.memo = memo;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getDeveui() {
		return deveui;
	}

	public void setDeveui(String deveui) {
		this.deveui = deveui;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getMapid() {
		return mapid;
	}

	public void setMapid(String mapid) {
		this.mapid = mapid;
	}

	public float getX() {
		return x;
	}

	public void setX(float x) {
		this.x = x;
	}

	public float getY() {
		return y;
	}

	public void setY(float y) {
		this.y = y;
	}

	public String getAlarm() {
		return alarm;
	}

	public void setAlarm(String alarm) {
		this.alarm = alarm;
	}

	public String getAlarmStr() {
		return alarmStr;
	}

	public void setAlarmStr(String alarmStr) {
		this.alarmStr = alarmStr;
	}

	public String getRang() {
		return rang;
	}

	public void setRang(String rang) {
		this.rang = rang;
	}

	public String getRangStr() {
		return rangStr;
	}

	public void setRangStr(String rangStr) {
		this.rangStr = rangStr;
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getRecv() {
		return recv;
	}

	public void setRecv(Date recv) {
		this.recv = recv;
	}

	public Date getOfftimebegin() {
		return offtimebegin;
	}

	public void setOfftimebegin(Date offtimebegin) {
		this.offtimebegin = offtimebegin;
	}

	public Date getOfftimeend() {
		return offtimeend;
	}

	public void setOfftimeend(Date offtimeend) {
		this.offtimeend = offtimeend;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getTypeStr() {
		return typeStr;
	}

	public void setTypeStr(String typeStr) {
		this.typeStr = typeStr;
	}

	public Integer getRssi() {
		return rssi;
	}

	public void setRssi(Integer rssi) {
		this.rssi = rssi;
	}

	public float getSnr() {
		return snr;
	}

	public void setSnr(float snr) {
		this.snr = snr;
	}

	public String getBattery() {
		return battery;
	}

	public void setBattery(String battery) {
		this.battery = battery;
	}

	public Date getStatustime() {
		return statustime;
	}

	public void setStatustime(Date statustime) {
		this.statustime = statustime;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((alarm == null) ? 0 : alarm.hashCode());
		result = prime * result + ((alarmStr == null) ? 0 : alarmStr.hashCode());
		result = prime * result + ((alias == null) ? 0 : alias.hashCode());
		result = prime * result + ((battery == null) ? 0 : battery.hashCode());
		result = prime * result + ((deveui == null) ? 0 : deveui.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((mapid == null) ? 0 : mapid.hashCode());
		result = prime * result + ((memo == null) ? 0 : memo.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((offtimebegin == null) ? 0 : offtimebegin.hashCode());
		result = prime * result + ((offtimeend == null) ? 0 : offtimeend.hashCode());
		result = prime * result + ((rang == null) ? 0 : rang.hashCode());
		result = prime * result + ((rangStr == null) ? 0 : rangStr.hashCode());
		result = prime * result + ((recv == null) ? 0 : recv.hashCode());
		result = prime * result + ((rssi == null) ? 0 : rssi.hashCode());
		result = prime * result + ((sn == null) ? 0 : sn.hashCode());
		result = prime * result + Float.floatToIntBits(snr);
		result = prime * result + ((statustime == null) ? 0 : statustime.hashCode());
		result = prime * result + ((type == null) ? 0 : type.hashCode());
		result = prime * result + ((typeStr == null) ? 0 : typeStr.hashCode());
		result = prime * result + Float.floatToIntBits(x);
		result = prime * result + Float.floatToIntBits(y);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Blegateway other = (Blegateway) obj;
		if (alarm == null) {
			if (other.alarm != null)
				return false;
		} else if (!alarm.equals(other.alarm))
			return false;
		if (alarmStr == null) {
			if (other.alarmStr != null)
				return false;
		} else if (!alarmStr.equals(other.alarmStr))
			return false;
		if (alias == null) {
			if (other.alias != null)
				return false;
		} else if (!alias.equals(other.alias))
			return false;
		if (battery == null) {
			if (other.battery != null)
				return false;
		} else if (!battery.equals(other.battery))
			return false;
		if (deveui == null) {
			if (other.deveui != null)
				return false;
		} else if (!deveui.equals(other.deveui))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (mapid == null) {
			if (other.mapid != null)
				return false;
		} else if (!mapid.equals(other.mapid))
			return false;
		if (memo == null) {
			if (other.memo != null)
				return false;
		} else if (!memo.equals(other.memo))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (offtimebegin == null) {
			if (other.offtimebegin != null)
				return false;
		} else if (!offtimebegin.equals(other.offtimebegin))
			return false;
		if (offtimeend == null) {
			if (other.offtimeend != null)
				return false;
		} else if (!offtimeend.equals(other.offtimeend))
			return false;
		if (rang == null) {
			if (other.rang != null)
				return false;
		} else if (!rang.equals(other.rang))
			return false;
		if (rangStr == null) {
			if (other.rangStr != null)
				return false;
		} else if (!rangStr.equals(other.rangStr))
			return false;
		if (recv == null) {
			if (other.recv != null)
				return false;
		} else if (!recv.equals(other.recv))
			return false;
		if (rssi == null) {
			if (other.rssi != null)
				return false;
		} else if (!rssi.equals(other.rssi))
			return false;
		if (sn == null) {
			if (other.sn != null)
				return false;
		} else if (!sn.equals(other.sn))
			return false;
		if (Float.floatToIntBits(snr) != Float.floatToIntBits(other.snr))
			return false;
		if (statustime == null) {
			if (other.statustime != null)
				return false;
		} else if (!statustime.equals(other.statustime))
			return false;
		if (type == null) {
			if (other.type != null)
				return false;
		} else if (!type.equals(other.type))
			return false;
		if (typeStr == null) {
			if (other.typeStr != null)
				return false;
		} else if (!typeStr.equals(other.typeStr))
			return false;
		if (Float.floatToIntBits(x) != Float.floatToIntBits(other.x))
			return false;
		if (Float.floatToIntBits(y) != Float.floatToIntBits(other.y))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Blegateway [id=" + id + ", deveui=" + deveui + ", alias=" + alias + ", mapid=" + mapid + ", x=" + x
				+ ", y=" + y + ", alarm=" + alarm + ", alarmStr=" + alarmStr + ", rang=" + rang + ", rangStr=" + rangStr
				+ ", sn=" + sn + ", name=" + name + ", recv=" + recv + ", offtimebegin=" + offtimebegin
				+ ", offtimeend=" + offtimeend + ", type=" + type + ", typeStr=" + typeStr + ", rssi=" + rssi + ", snr="
				+ snr + ", battery=" + battery + ", statustime=" + statustime + ", memo=" + memo + "]";
	}

	
}
